package Service::HomeEnvironmentService;

use strict;
use warnings;
use 5.010;

use Exporter qw(import);
use Persistance::HomeEnvironmentDao;
use Native::DataCollector;

sub get_room_temperature_list {
	my @data = Persistance::HomeEnvironmentDao::get_room_temperature_data();

	return @data;
}

sub get_room_brightness_list {
	my @data = Persistance::HomeEnvironmentDao::get_room_brightness_alert_data();

	return @data;
}

sub get_room_firesafety_list {
	my @data = Persistance::HomeEnvironmentDao::get_room_firesafety_alert_data();

	return @data;
}

sub get_current_home_environment {
	my $temperature = Native::DataCollector::collect_current_home_temperature();
	my $brightness = Native::DataCollector::collect_current_home_brightness_status();
	my $firesafety = Native::DataCollector::collect_current_home_firesafety_status();
	my %current_data = (
		temperature => $temperature,
		brightness => $brightness,
		firesafety => $firesafety,
	);
	my @data = (\%current_data);

	return @data;
}

sub generate_temperature_linechart_picture {
    my $resultCode = Native::DataCollector::generate_temperature_linechart();

    return $resultCode;
} 

1;
